/*
 * Copyright (c) 2006, 2023, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

/**
 * <p>Project: jse2302 - Str3
 * <p>Powered by webrx On 2023-06-19 14:58:53
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Str3 {

    public static void main(String[] args) {
        System.out.println("hello".concat("java").concat("aaa"));
        System.out.println("hello" + "java");
        System.out.println("日一二三四五六".substring(1));
        System.out.println("日一二三四五六".substring(1,3));
        System.out.println("日一二三四五六".charAt(6));

        //
        System.out.println("java hello java ".indexOf("java"));
        System.out.println("java hello java ".lastIndexOf("java"));
        System.out.println("java hello java ".indexOf("python"));
        System.out.println("java hello java ".lastIndexOf("python"));
        System.out.println("java hello java ".toUpperCase().toLowerCase());

        //将字符串对象转换为char[]
        char[] cs = "java".toCharArray();
        System.out.println(cs);

        //使用new String()将char数组转换为字符串
        System.out.println(new String(cs));

        String[] sp = "java".split("");
        System.out.println(sp.length);
        String[] ws = "日一二三四五六".split("");
        System.out.println(ws[0]);

    }
}
